package cn.gov.pbc.gd.credit.web.controller.log;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.gov.pbc.gd.credit.log.service.inquiry.ILogInquiryService;
import cn.gov.pbc.gd.credit.log.service.login.ILogLoginService;
import cn.gov.pbc.gd.credit.log.service.operate.ILogOperateService;
import cn.gov.pbc.gd.credit.vo.log.LogInquiryVo;
import cn.gov.pbc.gd.credit.vo.log.LogLoginVo;
import cn.gov.pbc.gd.credit.vo.log.LogOperateVo;

@Controller
@RequestMapping("/log")
public class LogController {

	@Autowired
	private ILogLoginService logLoginService;
	
	@Autowired
	private ILogOperateService logOperateService;
	
	@Autowired
	private ILogInquiryService logInquiryService;
	
	@RequestMapping("/login/page")
	public String loginPage(LogLoginVo vo, Model model, HttpServletRequest request){
		
		model.addAttribute("result", logLoginService.page(vo, request));
		
		return "log/login/page";
	}
	
	@RequestMapping("/operate/page")
	public String operatePage(LogOperateVo vo, Model model, HttpServletRequest request){
		
		model.addAttribute("result", logOperateService.page(vo, request));
		return "log/operate/page";
	}
	
	@RequestMapping("/inquiry/page")
	public String inquiryPage(LogInquiryVo vo, Model model, HttpServletRequest request){
		
		model.addAttribute("result", logInquiryService.page(vo, request));
		
		return "log/inquiry/page";
	}
}
